home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
bp7bugs1.zip
/
OUTLINE.FIX
< prev
next >
Wrap
Text File
|
1992-12-01
|
779b
|
31 lines
The DisposeNode procedure in the Outlines unit neglects to dispose of the
Text string allocated by NewNode. This means that disposing of a POutline
object leaves all the strings sitting in memory. It's also got redundant
tests to avoid disposing of a nil pointer.
It should be fixed as follows. Change from:
procedure DisposeNode(Node: PNode);
begin
if Node <> nil then
with Node^ do
begin
if ChildList <> nil then DisposeNode(ChildList);
if Next <> nil then DisposeNode(Next);
end;
Dispose(Node);
to:
procedure DisposeNode(Node: PNode);
begin
if Node <> nil then
with Node^ do
begin
DisposeNode(ChildList);
DisposeNode(Next);
DisposeStr(Text);
Dispose(Node);
end;
end;